Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kill: adding support for handling SIGEXIT #6269

Merged
merged 4 commits into from
Apr 27, 2024

Conversation

dcarrier
Copy link
Contributor

Adding support for handling SIGEXIT as mentioned in Issue-6628.

Before this change the nix library would return an EINVAL when passing SIGEXIT / EXIT to uutils/coretutils kill.

After this change nix passes 0 to libc kill as shown here.

.try_into()
.map_err(|e| std::io::Error::from_raw_os_error(e as i32))?;
let sig_name = signal_name_by_value(sig);
let sig: Option<Signal> = if sig_name.is_some_and(|name| name == "EXIT") {
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add a comment, it isn't super obvious :)

Copy link
Contributor Author

@dcarrier dcarrier Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, very good point! Added.

Copy link

GNU testsuite comparison:

GNU test failed: tests/timeout/timeout. tests/timeout/timeout is passing on 'main'. Maybe you have to rebase?

tests/kill: test handling SIGEXIT

kill: pass unqualified None for consistency
@dcarrier
Copy link
Contributor Author

Rebased on main to attempt to fix CI and amend commit to follow best practices.

Copy link
Collaborator

@BenWiederhake BenWiederhake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does exactly what it says on the tin, tests that the invocation works and will never regress. Great!

@BenWiederhake BenWiederhake merged commit 5ee9c69 into uutils:main Apr 27, 2024
67 of 68 checks passed
@dcarrier dcarrier deleted the issue-6228 branch April 27, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants